<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <!-- 事件处理 -->
    <div id="app">
        <button @click="c1">{{message1}}</button>
        <button v-on:click.once="c2">{{message2}}</button>
        <a href="http://www.163.com" target="_blank">普通的链接</a>
        <a @click.prevent  href="http://www.163.com" target="_blank">取消默认的行为</a>
    </div>
    <script>
        // 创建Vue的对象
        let vm = new Vue({
            el:"#app",
            data:{
                message1:"hello",
                message2:"hello"
            },
            // 在 `methods` 对象中定义方法
            methods: {
                c1(){
                    this.message1 = this.message1+' vue!!!!!!';
                },
                c2(){
                    this.message2 = this.message2+' vue!!!!!!';
                }
            }
        })
    </script>
</body>
</html>